home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / and.z / and
Encoding:
Text File  |  1998-10-30  |  4.1 KB  |  98 lines

  1. AND(3M)                                                Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      AANNDD - Computes logical product
  6.  
  7. SSYYNNOOPPSSIISS
  8.      AANNDD (([II==]_i,,[JJ==]_j))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, and IRIX systems
  12.  
  13. SSTTAANNDDAARRDDSS
  14.      Compiler extension to Fortran 90
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      AANNDD is an elemental function for the CF90 compiler.  _a_r_g, _i, or _j can
  18.      be of type Boolean, integer, real, or Cray pointer.  The _i and _j
  19.      arguments can also be of type logical.
  20.  
  21. NNOOTTEESS
  22.      AANNDD is an outmoded routine for the CF90 compiler.  Refer to the
  23.      _F_o_r_t_r_a_n _L_a_n_g_u_a_g_e _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, _V_o_l_u_m_e _3, publication SR-3905, for
  24.      information about outmoded features and their preferred standard
  25.      alternatives.  The name of this intrinsic cannot be passed as an
  26.      argument.
  27.  
  28. CCAAUUTTIIOONNSS
  29.      Unexpected results can occur when Boolean functions are declared
  30.      external and then used with logical arguments.  The external Boolean
  31.      functions always treat their arguments as type Boolean and return a
  32.      Boolean result on UNICOS and UNICOS/mk systems.  On IRIX systems, they
  33.      return an integer result.
  34.  
  35. RREETTUURRNN VVAALLUUEESS
  36.      When given two arguments of type logical, AANNDD computes a logical
  37.      product and returns a logical result.
  38.  
  39.      When given two arguments of type Boolean, integer, real, or pointer,
  40.      AANNDD computes a bit-wise logical product and returns a Boolean result.
  41.      No type conversion occurs.
  42.  
  43.      The following tables show both the logical product and bit-wise
  44.      logical product:
  45.  
  46.      ---------------------------------------------------------------------
  47.         Logical        Logical             (Logical Variable 1) AANNDD
  48.       Variable 1     Variable 2              (Logical Variable 2)
  49.      ---------------------------------------------------------------------
  50.            T              T                           T
  51.            T              F                           F
  52.            F              T                           F
  53.            F              F                           F
  54.      ---------------------------------------------------------------------
  55.  
  56.      ------------------------------------------------------------------
  57.         Bit of        Bit of            (Bit of Variable 1) AANNDD
  58.       Variable 1    Variable 2            (Bit of Variable 2)
  59.      ------------------------------------------------------------------
  60.           1             1                          1
  61.           1             0                          0
  62.           0             1                          0
  63.           0             0                          0
  64.      ------------------------------------------------------------------
  65.  
  66. EEXXAAMMPPLLEESS
  67.      The following section of Fortran code shows the AANNDD function used with
  68.      two arguments of type logical:
  69.  
  70.           LOGICAL L1, L2, L3
  71.           ...
  72.           L3 = AND(L1,L2)
  73.  
  74.      The following section of Fortran code shows the AANNDD function used with
  75.      two arguments of type integer.  The bit patterns of the arguments and
  76.      result are also given.  For clarity, only the rightmost 8 bits are
  77.      shown.
  78.  
  79.       INTEGER I1, I2, I3
  80.       I1 = 12
  81.       I2 = 10
  82.       ...
  83.       I3 = AND(I1,I2)
  84.        -------------------------------     -------------------------------
  85.       | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 |   | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
  86.        -------------------------------     -------------------------------
  87.                         I1                               I2
  88.  
  89.                         -------------------------------
  90.                        | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
  91.                         -------------------------------
  92.                                         I3
  93.  
  94. SSEEEE AALLSSOO
  95.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  96.      printed version of this man page.
  97.  
  98.